package com.level2app.config;

import com.level2app.utils.SPUtils;

/**
 * Created by S
 * time 2024/8/19
 */
public class CoreManager {


    /**
     * 邀请码
     */
    public static void setReferralCode(String code) {
        SPUtils.getInstance().put(Constant.REFERRAL_CODE, code);
    }

    public static String getReferralCode() {
        return SPUtils.getInstance().getString(Constant.REFERRAL_CODE);
    }

    /**
     * 邮箱
     */
    public static void setEmail(String email) {
        SPUtils.getInstance().put(Constant.EMAIL, email);
    }

    public static String getEmail() {
        return SPUtils.getInstance().getString(Constant.EMAIL);
    }

    /**
     * 是否登录
     */
    public static void setIsLogin(boolean isLogin) {
        SPUtils.getInstance().put(Constant.IS_LOGIN, isLogin);
    }

    public static boolean getIsLogin() {
        return SPUtils.getInstance().getBoolean(Constant.IS_LOGIN);
    }

    /**
     * token
     */
    public static void setToken(String access) {
        SPUtils.getInstance().put(Constant.USER_ACCESS, access);
    }

    public static String getToken() {
        return SPUtils.getInstance().getString(Constant.USER_ACCESS);
    }

    /**
     * refresh
     */
    public static void setRefresh(String access) {
        SPUtils.getInstance().put(Constant.USER_REFRESH, access);
    }

    public static String getRefresh() {
        return SPUtils.getInstance().getString(Constant.USER_REFRESH);
    }

}